import 'babel-polyfill'
import 'classlist-polyfill'
import Vue from 'vue'
import axios from './router/axios'
import VueAxios from 'vue-axios'
import App from './App'
import './permission' // 权限
import './error' // 日志
import './cache'//页面缓冲
import router from './router/router'
import store from './store'
import VueDND from 'awe-dnd';//表格拖拽组件
import { loadStyle } from './util/util'
import { loadJs } from './util/util'
import * as urls from '@/config/env'
// import { iconfontUrl, iconfontVersion } from '@/config/env'
import { iconfontSymbolUrl } from '@/config/env'
import * as filters from './filters' // 全局filter
import ElementUI from 'element-ui'
// import 'element-ui/lib/theme-chalk/index.css'
import './styles/indexNews.css'
import './styles/common.scss'
// 图标库引用
import './styles/fonts/font_667895_v7uduh4zui.css'
import './styles/fonts/font_1638883_qi08jij1ln.css'
import './styles/fonts/font_2617855_1j03nd5tjo.css'
import './styles/fonts/font_667895_v7uduh4zui.js'
import './styles/fonts/font_1638883_qi08jij1ln.js'
import './styles/fonts/font_2617855_1j03nd5tjo.js'
import AvueFormDesign from '@sscfaith/avue-form-design'
import basicContainer from './components/basic-container/main'
import navigation from './components/navigation/head'
import navigationHeTong from './components/navigation/head-hetong'
import navigationRenWuShu from './components/navigation/head-renwushu'
import navigationZDRW from './components/navigation/head-zhongdianrenwu'
import navigationZXGZ from './components/navigation/head-zhuanxianggongzuo'
import navigationZhuanX from './components/navigation/head-zhuanxiang'
import headAssessment from './components/navigation/head-assessment'
//日常考核 by mingyue
import headDailyExnamine from './views/dailyExamine/components/head-dailyExamine'
//时间格式化控件引入
import moment from 'moment'
Vue.prototype.$moment = moment
//奖金金额格式化引入
import {formatNum} from "./util/formatNum"
Vue.prototype.$formatNum = formatNum
moment.locale('zh-cn'); //汉化
// 插件 json 展示
Vue.use(router)

//表格拖拽组件
Vue.use(VueDND);

Vue.use(AvueFormDesign);



window.axios = axios
Vue.use(VueAxios, axios)

Vue.use(ElementUI, {
  size: 'small',
  menuType: 'text'
})

import {Notification} from "element-ui";
Vue.prototype.$message = Notification

Vue.use(AVUE, {
  size: 'small',
  menuType: 'text'
})

// 注册全局容器
Vue.component('basicContainer', basicContainer)
Vue.component('navigation', navigation)
Vue.component('navigationHeTong', navigationHeTong)
Vue.component('navigationRenWuShu', navigationRenWuShu)
Vue.component('navigationZDRW', navigationZDRW)
//新增
Vue.component('navigationZXGZ', navigationZXGZ)

Vue.component('navigationZhuanX', navigationZhuanX)
Vue.component('headAssessment', headAssessment)
// headAssessment

//日常
Vue.component('headDailyExnamine', headDailyExnamine)

//奖金新 验证全局(配置了动态的列或者表单是动态时，如果不注册全局，在单页面引入会报方法未定义)
import validateUtil from "@/api/bonus/utils";
Vue.prototype.$validateUtil = validateUtil;

// 加载相关url地址
Object.keys(urls).forEach(key => {
  Vue.prototype[key] = urls[key]
})

// 加载过滤器
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

// 动态加载阿里云字体库
// iconfontVersion.forEach(ele => {
//   loadStyle(iconfontUrl.replace('$key', ele))
//   loadJs(iconfontSymbolUrl.replace('$key', ele))
// })

Vue.config.productionTip = false

new Vue({
  router,
  store,
  // VueDND,
  render: h => h(App)
}).$mount('#app')
